package com.xsmart.oa.dao.wx;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface UserInfoDao {

    /**
     * 查询会员信息
     * @param userId
     * @return
     */
    @Select("select * from INFS_USER where user_id=#{userId} ")
    Map<String,Object> queryUserInfo(@Param("userId") Integer userId);

    /**
     * 查询会员申请分销商状态
     * @param userId
     * @return
     */
    @Select("select status, check_remark " +
            "from infu_user_request_type_task " +
            "where user_id=#{userId} " +
            "ORDER BY create_time DESC LIMIT 0,1")
    Map<String, Object> queryApplyStatus(@Param("userId") Integer userId);

    @Select("select * from cfgs_sys_param where param_code=#{paramCode} and param_status = 1")
    @Cacheable(value = "sysParam")
    Map<String,Object> findByParamCode(@Param("paramCode") String paramCode);

}
